package com.kmxd.ams.core.mybatisplus;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.kmxd.ams.core.mybatisplus.extend.SelectListNoDataScope;
import java.util.List;

/**
 * 自定义sql注入
 *
 * @author nickbi
 */
public class MySqlInjector extends DefaultSqlInjector {

  @Override
  public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
    List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
    // 添加无权限 列表查询
    methodList.add(new SelectListNoDataScope());
    return methodList;
  }
}
